<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/9/18
 * Time: 10:28
 */
//error_reporting(E_ALL);
$newfunc = create_function('$a,$b', 'return "ln($a) + ln($b) = " . log($a * $b);');
echo "New anonymous function: $newfunc\n";
echo $newfunc(2, M_E) . "\n";
// outputs
// New anonymous function: lambda_1
// ln(2) + ln(2.718281828459) = 1.6931471805599

